package ua.kpi_java_training.evgeniygusar.module3.tests;

import org.junit.Test;
import ua.kpi_java_training.evgeniygusar.module3.*;

public class AllObstaclesTest {
    AllObstacles obstaclesObject = new AllObstacles();

    @Test
    public void testAddObstacle() {
        obstaclesObject.addObstacle();
        assert(4==obstaclesObject.numbersOfObstacles());
    }


    @Test
    public void testCheckObstacleInXY()  throws Exception {
        obstaclesObject.addObstacle();
        obstaclesObject.getObstacle(0).x = 1;
        obstaclesObject.getObstacle(0).y = 1;
        obstaclesObject.addObstacle();
        obstaclesObject.getObstacle(1).x = 2;
        obstaclesObject.getObstacle(1).y = 2;
        obstaclesObject.addObstacle();
        obstaclesObject.getObstacle(2).x = 3;
        obstaclesObject.getObstacle(2).y = 3;
        assert(true==obstaclesObject.checkObstacleInXY(2,2));
    }
}
